package com.x.chalk.controller;

import com.x.chalk.config.SystemConfig;
import com.x.chalk.entity.Resume;
import com.x.chalk.service.intf.ResumeService;
import com.x.chalk.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/api/resume/")
@CrossOrigin
@Api(tags = "招考中的个人简历")
public class ResumeController {
    @Autowired
    private ResumeService service;

    /**
     * 添加简历
     */
    public R save(@ApiParam(value = "简历中的内容对象") Resume resume){
        return service.save(resume);
    }

    /**
     * 查看简历
     */
    public R selectOne(HttpServletRequest request){
        return service.selectOne(request.getHeader(SystemConfig.HEADER_TOKEN));
    }
}
